function [a,P] = GoKick(P,S,mode)

% game parameters
global num_players_r;
global num_players_b;

if(P{2}=='r')
    num_players = num_players_r;
else
    num_players = num_players_b;
end

if(PlayerInPossession(P,S,mode))
    [a, P] = Dribble(P);
    SaveMemory(P,false,1,0);
else
    [a, P] = GoToBall(P,S,mode);
    SaveMemory(P,true,3+num_players,0);
end            
            
